#include"AVL.h"
#include<vector>
using std::vector;
using std::cout;
using std::endl;

int main()
{
   // int arr[]={1,2,3,4,5,6,7,7,8,9,0};
    //int arr[] = {16,3,7,11,9,28,18,14,15};
    int arr[] = {4,2,6,1,3,5,15,7,16,14};
    xzj::AVLTree<int> avl;
    for(int e:arr)
    {
        avl.insert(e);
    }

    avl.InOrder();
    std::cout<<avl.IsBalanceTree()<<std::endl;;

    int N = 100000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));
	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand() + i);
	}
	size_t begin2 = clock();
	xzj::AVLTree<int> t;
	for (auto e : v)
	{
		t.insert(e);
	}

	size_t end2 = clock();
	cout << "Insert:" << end2 - begin2 << endl;
	cout << t.IsBalanceTree() << endl;
	cout << "Height:" << t.height() << endl;
    return 0;
}
